<template>
  <div class="not-found">
    <div class="not-found-container">
      <div class="error-code">404</div>
      <div class="error-message">页面未找到</div>
      <div class="error-description">
        抱歉，您访问的页面不存在或已被移动
      </div>
      
      <div class="actions">
        <button class="btn-primary" @click="goHome">
          <i class="icon-home"></i>
          返回首页
        </button>
        <button class="btn-secondary" @click="goBack">
          <i class="icon-back"></i>
          返回上页
        </button>
      </div>
      
      <div class="suggestions">
        <h3>您可能想要访问：</h3>
        <ul>
          <li>
            <router-link to="/monitoring">智能瓷砖监控平台</router-link>
          </li>
          <li>
            <router-link to="/monitoring/realtime">实时数据监控</router-link>
          </li>
          <li>
            <router-link to="/monitoring/heatmap">压力热图分析</router-link>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'NotFound',
  methods: {
    goHome() {
      this.$router.push('/')
    },
    goBack() {
      if (window.history.length > 1) {
        this.$router.go(-1)
      } else {
        this.$router.push('/')
      }
    }
  }
}
</script>

<style scoped>
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: 'Inter', sans-serif;
}

.not-found-container {
  text-align: center;
  max-width: 600px;
  padding: 40px 20px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: #1677FF;
  margin-bottom: 20px;
  text-shadow: 0 4px 8px rgba(22, 119, 255, 0.2);
}

.error-message {
  font-size: 32px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.88);
  margin-bottom: 16px;
}

.error-description {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.65);
  margin-bottom: 40px;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 40px;
}

.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: #1677FF;
  color: white;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

.btn-primary:hover {
  background: #0958d9;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 119, 255, 0.4);
}

.btn-secondary {
  background: white;
  color: rgba(0, 0, 0, 0.88);
  border: 1px solid #d9d9d9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: #1677FF;
  color: #1677FF;
  transform: translateY(-2px);
}

.icon-home::before {
  content: "🏠";
}

.icon-back::before {
  content: "←";
}

.suggestions {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: left;
}

.suggestions h3 {
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.88);
  margin-bottom: 16px;
  text-align: center;
}

.suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.suggestions li {
  margin-bottom: 12px;
}

.suggestions a {
  display: block;
  padding: 12px 16px;
  color: #1677FF;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.suggestions a:hover {
  background: #f0f7ff;
  border-color: #1677FF;
  transform: translateX(4px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .not-found-container {
    padding: 20px;
  }
  
  .error-code {
    font-size: 80px;
  }
  
  .error-message {
    font-size: 24px;
  }
  
  .actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 200px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .error-code {
    font-size: 60px;
  }
  
  .error-message {
    font-size: 20px;
  }
  
  .suggestions {
    padding: 16px;
  }
}
</style>
